home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 3.2 KB | 68 lines | [TEXT/GEOL] |
- Item 9433367 16-Aug-90 00:35PDT
-
- From: AUST0338 AUPtnr - Tactics Int'l,Shillito,IDV
-
- To: ROSENSTEIN1 Rosenstein, Larry
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: RE[2] Performance w/too many
-
- To: ROSENSTEIN1 - Larry Rosenstein
- From: AUST0338 - David Shillito
- Date: Thursday 16th August 1990
- Subject: RE: Performance with too many handles
-
- Larry,
-
- Thank you for your detailed response to my link.
-
- I will try to get hold of the article you mention on using separate heaps,
- although there is no chance that I will introduce C++ into this project (or any
- other).
-
- I have investigated some of your other suggestions. The idea about allocating
- more master pointers was a good one I had forgotten about. I was calling
- InitUMacApp with 25, ie. getting 25*64 master pointers, which also results in
- subsequent increments being 64 master pointers at a time. I have changed the
- value moreMast in my heap zone to 1000 before calling InitUMacApp with a value
- of 2. This means that I now allocate my master pointers 1000 at a time. However
- this made little noticeable difference.
-
- I used MacsBug and the HT command to check out the heap fragmenmtation and I
- really dont think that "fragmentation" is a problem. I had 16 blocks in the
- free list, 20,000 relocatable blocks, 4,500,000 bytes free and most of this was
- in one piece in the free list.
-
- I thought about which operations that the system does a lot that might involve
- scanning through the whole of the heap and decided to put A-trap breakpoints on
- CompactMem, ResrvMem, MoveHHi and so on. What I discovered is that MoveHHi is
- called for virtually anything I do, such as moving the cursor and setting a new
- cursor region, activating a window and so on. The reason for this is that
- segments are being unloaded back in the idle loop and reloaded to do any of
- these activities. Each segment load involves a call to LoadMacAppSegment which
- calls PreloadSegmentResource which calls LockHandleHigh wich calls MoveHHi. All
- of this is as it should be, of course, and I dont wish to mess with it.
- However, it seems that calls to MoveHHi could be expensive in an environment
- where there are 20,000 blocks in the heap. Which brings us back to the
- desirability of separating at least the heap used for code segments from the
- heap used for most of my application data.
-
- However, perhaps there is a way to affect the layout of the relocatable blocks
- in memory that will reduce the amount of work MoveHHi has to do. I am starting
- to get out of my depth here, but is it possible that the code segmenmts
- involved were first loaded early on and now sit below my 20,000 blocks and
- MoveHHi has to scan over all of them; whereas if the code segments could be
- completely removed from memory and reallocated higher in the heap the amount of
- overhead could be reduced?
-
- By the way, my objections (perhaps they are spurious but this decision was made
- about 2 years ago) to using objects instead of just handles for my dynamic data
- structures include:
- 1. The additional memory overhead for a TObject.
- 2. The additional runtime and space overhead when running in debug while the
- inspector adds each new object to its lists.
-
- David Shillito
-
-